# 元组相关的操作

tuple1 = (1, 2, 3)
tuple2 = (4, 5, 6)

tuple3 = tuple1 + tuple2
print(tuple3)

# (1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6)
print(tuple3 * 2)

# 判断元组中是否存在1
print(1 in tuple3)

# 截取操作 (x, y]
print(tuple3[2:])
print(tuple3[:2])

# 拿到145
tuple4 = (1, 2, 3, (12, 123, 145))
print(tuple4[3][2])

# 将list转化成元组
list1 = [1, 2, 3]
tuple5 = tuple(list1)
print(tuple5)



